//
//  ChinaArea.m
//  10803
//
//  Created by student on 16/2/24.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ChinaArea.h"

static ChinaArea *instance = nil;

@interface ChinaArea ()

@property (nonatomic,strong) NSArray *provinces;
@property (nonatomic,strong) NSDictionary *cities;

@end

@implementation ChinaArea

+ (ChinaArea *)sharedChinaAreas
{
    if (instance == nil) {
        instance = [[ChinaArea alloc]init];
    }
    return instance;
}

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        NSString *path = [[NSBundle mainBundle]pathForResource:@"area1" ofType:@"plist"];
        self.provinces = [NSArray arrayWithContentsOfFile:path];
        self.cities = [NSDictionary dictionaryWithContentsOfFile:path];
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

+ (NSDictionary *)provinces
{
    ChinaArea *c = [ChinaArea sharedChinaAreas];
    return c.cities;
}


+ (NSDictionary *)citsForProvince:(NSString *)province
{
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
